#pragma once

#include <QObject>
#include<QTimer>
#include<QThread>
#include "ubSiemensPLC.h"
class CWriteThread  : public QObject
{
	Q_OBJECT

public:
	CWriteThread(QObject *parent =nullptr);
	~CWriteThread();


	void start(int interval);

	void stop();

	void set_enable(bool enable);
	bool get_enable();


public slots:

	void threadRun();


private:
	bool m_enable = false;
	QThread* thread;
	QTimer* timer;

	int runNum = 0;
	ubSiemensPLC* m_siemensPLC;
};
